import GraphBack from '../../src'
const canvas = document.createElement('canvas')
canvas.style.position = 'fixed'
canvas.style.width = canvas.style.height = '100%'
canvas.style.top = canvas.style.left = '0'
document.body.appendChild(canvas)

// 场景
const scene = new GraphBack.Scene(canvas)

const rect = new GraphBack.Rect({ x: 20, y: 100, width: 10, height: 20, color: 'red' })
const transform = new GraphBack.Transform(rect).array(10, 20, 0).array(4, 0, 40).skewX(1)
scene.add(transform)

const rect2Width = 10
const rect2Height = 20
const rect2Count = 10
const rect2 = new GraphBack.Rect({ x: 100, y: 300, width: rect2Width, height: rect2Height, color: 'green' })
const transform2 = new GraphBack.Transform(rect2)
  .array(rect2Count)
  .origin({ x: rect2Width / 2, y: rect2Height + 25 })
  .rotate((Math.PI * 2) / rect2Count, true)
scene.add(transform2)

scene.render()
